<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">

<title><g:layoutTitle default="${meta(name:'app.name')}" /></title>
<link rel="shortcut icon"
	href="${resource(dir:'images',file:'favicon.ico')}" type="image/x-icon" />

<!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
<!--[if lt IE 9]>
	  <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
	<![endif]-->

<link rel="stylesheet"
	href="${resource(dir:'bootstrap/css',file:'bootstrap.css')}" />
<link rel="stylesheet"
	href="${resource(dir:'bootstrap/css',file:'bootstrap-responsive.css')}" />
<link rel="stylesheet"
	href="${resource(dir:'kickstart/css',file:'docs.css')}" />
<link rel="stylesheet"
	href="${resource(dir:'kickstart/css',file:'kickstart.css')}" />

<link rel="apple-touch-icon" href="assets/ico/apple-touch-icon.png">
<link rel="apple-touch-icon" sizes="72x72"
	href="assets/ico/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="114x114"
	href="assets/ico/apple-touch-icon-114x114.png">

<g:layoutHead />

<!-- Note: Place at the end of the document to load faster -->
<script
	src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="${resource(dir:'bootstrap/js',file:'bootstrap.js')}"></script>
<script src="${resource(dir:'kickstart/js',file:'kickstart.js')}"></script>
<g:javascript library="application" />


<r:layoutResources />
<style type="text/css">
footer {
	height: 50px;
	background: #126499;
	border-top: 1px solid #EEE;
	text-align: center;
}
</style>
</head>

<body>
	<div id="Navbar" class="navbar navbar-fixed-top">
		<div class="navbar-inner">
			<div class="container">
				<!-- .btn-navbar is used as the toggle for collapsed navbar content -->
				<a class="btn btn-navbar" data-toggle="collapse"
					data-target=".nav-collapse"> <span class="icon-bar"></span> <span
					class="icon-bar"></span> <span class="icon-bar"></span>
				</a> <a class="brand" href="${createLink(uri: '/')}"> <img
					class="logo"
					src="${resource(dir:'kickstart/img',file:'grails.png')}"
					alt="${meta(name:'app.name')}" height="25" border="0" /> ${meta(name:'app.name')}
					<small> v${meta(name:'app.version')}</small>
				</a>

				<div class="nav-collapse">

					<div class="pull-right">
						<g:render template="/menu/profile" />
					</div>
				</div>

			</div>
		</div>
	</div>

	<g:if test="${ pageProperty(name:'page.header') }">
		<g:pageProperty name="page.header" />
	</g:if>
	<g:else>
		<header id="Header" class="jumbotron masthead">


			<div class="container">
				<div class="row-fluid" style="margin: 0 auto; width: 70%">
					<div class="span6" style="margin-top: 5px;">
						<img src="${resource(dir:'images/demo',file:'5.jpg')}">
					</div>
					<div class="span6" style="margin-top: 5px;">
						<%--<img src="${resource(dir:'images/demo',file:'5.jpg')}">
						--%>
						<g:if test="${flash.message}">
							<div class="message">
								${flash.message}
							</div>
						</g:if>
						<g:if test="${!session.user }">

							<h1>Login</h1>
							<g:form action="signIn" controller="auth">
								<input type="hidden" name="targetUri" value="${targetUri}" />
								<table>
									<tbody>
										<tr>
											<td>Username:</td>
											<td><input type="text" name="username"
												value="${username}" /></td>
										</tr>
										<tr>
											<td>Password:</td>
											<td><input type="password" name="password" value="" /></td>
										</tr>
										<tr>
											<td>Remember me?:</td>
											<td><g:checkBox name="rememberMe" value="${rememberMe}" /></td>
										</tr>
										<tr>
											<td />
											<td><input type="submit" value="Sign in" /></td>
										</tr>
									</tbody>
								</table>
							</g:form>
						</g:if>
					</div>
				</div>
			</div>


		</header>
	</g:else>


	<g:if test="${params.controller == 'home' }">
		<div id="Content" class="container">
			<g:layoutBody />
		</div>
	</g:if>
	<g:else>
		<div id="Content" class="container-fluid">
			<div class="row-fluid">
				<g:if
					test="${params.controller != 'home' && params.controller !='auth'}">
					<div class="span3">
						<!--Sidebar content-->

						<div class="well sidebar-nav">

							<ul class="nav nav-list">
								<g:each in="${session.modules}" var="module">
									<li class="nav-header">
										${module.name}
									</li>
									<g:each in="${module.childrens }" var="child">
										<li <g:if test="${child.controllerName ==params.controller }">class='active'</g:if> ><g:link controller="${child.controllerName }">
												${child.name }
											</g:link></li>
									</g:each>
									<%--
							class="active"						
						--%>
								</g:each>
							</ul>

						</div>
						<!--/.well -->
					</div>
				</g:if>
				<div class="span9">
					<%-- Only show the "Pills" navigation menu if a controller exists (but not for home) --%>
					<g:if
						test="${	params.controller != null
					&&	params.controller != ''
					&&	params.controller != 'home'
					&& params.controller !='auth'
		}">
						<ul id="Menu" class="nav nav-pills">
							<g:set var="entityName"
								value="${message(code: params.controller+'.label', default: params.controller.substring(0,1).toUpperCase() + params.controller.substring(1).toLowerCase())}" />
							<%-- Set which "pill" of the menu is active --%>
							<li class="${ params.action == "list" ? 'active' : '' }"><g:link
									action="list">
									<g:message code="default.list.label" args="[entityName]" />
								</g:link></li>
							<li class="${ params.action == "create" ? 'active' : '' }"><g:link
									action="create">
									<g:message code="default.new.label" args="[entityName]" />
								</g:link></li>
						</ul>
					</g:if>

					<g:if test="${flash.message}">
						<div class="alert alert-info">
							${flash.message}
						</div>
					</g:if>

					<g:layoutBody />
				</div>
			</div>


			<g:pageProperty name="page.body" />
		</div>
	</g:else>
	<g:if test="${ pageProperty(name:'page.footer') }">
		<g:pageProperty name="page.footer" />
	</g:if>
	<g:else>

		<footer style="">

			<div class="container">
				<div class="copyright" style="margin: 0 auto;">
					<p>
						©2012 <a href="/" class="xiaomi_lnk">yuenar.com</a>
					</p>
				</div>
			</div>
		</footer>



	</g:else>

	<r:layoutResources />

	<script type="text/javascript">
		$('.carousel').carousel({
			interval : 8000
		})
	</script>
</body>

</html>